<?php

class Application_Form_Addbalance extends Zend_Form
{

    public function init() {
        $translate = new My_Action_Helper_Lang();
        //создаем объект формы регистрация и модели
        $users = new Zend_Form_Element_Select('users');
        $table = new Application_Model_Admin();
        //добавляем опции в форму
        $users->setLabel('User');
        //массивом передаем значения в select
        foreach ($table->getAllUsers() as $table) {
            $users->addMultiOption($table['id'], $table['email']);
        }
        
        $payment = $this->createElement('select', 'payment');
        $payment ->setLabel($translate->_('Payment'))
                 
                 ->addMultiOptions(array(
                                           'non-cash' => $translate->_('Non-cash payment'),
                                           'webmoney' => 'Webmoney'
                                         ));
        
        $rate = new Zend_Form_Element_Select('rate');
        $table = new Application_Model_Profile();
        $rate->addMultiOption(0, $translate->_('Select rate'));
            $rate->setLabel($translate->_('Rates'));
            //массивом передаем значения в select
            foreach ($table->getAllRates() as $table) {
                $rate->addMultiOption($table['name'], $table['name']);
        }                                 
        
        $count = $this->createElement('select', 'count');
        $count ->setLabel('Count')
                 
                 ->addMultiOptions(array(
                                           '1' => $translate->_('1 month'),
                                           '2' => $translate->_('2 month'),
                                           '3' => $translate->_('3 month')
                                         )); 
            
	$submit = new Zend_Form_Element_Submit('submit');
	$submit->setLabel($translate->_('Add'))
               ->setAttrib('class', 'button');
	         
        $this->addElements(array($users, $payment, $rate, $count, $submit));	         
	$this->setMethod('post');
    }


}

